﻿@using TamoCRM.Core
@using TamoCRM.Domain.UserRole
@model TamoCRM.Web.Mvc.Areas.Admin.Models.Reports.BC07Model
@{
    ViewBag.Title = "Báo cáo năng suất cuộc gọi của CTV";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";

    List<TamoCRM.Domain.SourceTypes.SourceTypeInfo> sourceTypes = ViewBag.SourceTypes;
    if (sourceTypes != null)
    {
        sourceTypes = sourceTypes.Where(c => c.SourceTypeId == (int)SourceType.CC || c.SourceTypeId == (int)SourceType.MO).ToList();
    }
    var lstSourceTypes = new SelectList(sourceTypes, "SourceTypeId", "Name");

    // User
    var users = ViewBag.Users;
    ((List<UserInfo>)users).RemoveAll(c => c.GroupId == 0);
    ((List<UserInfo>)users).Insert(0, new UserInfo { UserID = 0, FullName = "Tất cả" });
    var lstUsers = new SelectList(users, "UserID", "FullName");
}
<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try {
            ace.settings.check('breadcrumbs', 'fixed');
        } catch (e) { }
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="/Home">Trang chủ</a>
        </li>

        <li>
            <a href="javascript:void(0);">Danh mục</a>
        </li>
        <li class="active">Báo cáo</li>
    </ul>
</div>

<div class="page-content">
    <div class="page-header">
        <h1>Báo cáo năng suất cuộc gọi của CTV</h1>
    </div>
    <!-- /.page-header -->



    <div class="row">
        <div class="form-group">
            <div class="col-sm-12" id="alert">
            </div>
        </div>
        <div class="col-xs-12">
            @using (Ajax.BeginForm("BC11", "Report", new AjaxOptions { HttpMethod = "POST" }, new { enctype = "multipart/form-data", @class = "form-horizontal", role = "form", id = "uploadexcelform" }))
            {
                @Html.AntiForgeryToken()
                <div class="row">
                    <div class="col-xs-1" style="width: 5%;">
                        CTV
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.DropDownList("UserId", lstUsers, new { @style = "width: 100%" })
                        </div>
                    </div>
                    <div class="col-xs-1">
                        Từ ngày
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.TextBox("Name", DateTime.Now.ToString("dd/MM/yyyy"), new { @style = "width: 100%" })
                        </div>
                    </div>
                    <div class="col-xs-1">
                        Đến ngày
                    </div>
                    <div class="col-xs-2">
                        <div class="clearfix">
                            @Html.TextBox("Name", DateTime.Now.ToString("dd/MM/yyyy"), new { @style = "width: 100%" })
                        </div>
                    </div>
                </div>
                <div class="space-2"></div>
                <hr />
                <div class="space-2"></div>
                <button type="button" class="btn-import btn-primary" id="btnReport">Xuất báo cáo</button>
                <div class="clearfix"></div>
            }

            <div class="space-6"></div>
            <div id="mydiv">
                <iframe id="frame" style="width: 100%; height: 400px; border: none;"></iframe>
            </div>
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</div>
<!-- /.page-content -->
<script type="text/javascript">
    $(document).ready(function () {
        $("#ToDate").datepicker({ format: 'dd/mm/yyyy', autoclose: true });
        $("#btnReport").click(function (e) {
            e.preventDefault();
            var url = '/admin/report/ShowBC11';
            $("#frame").attr("src", url);
        });
    });
</script>
